<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>vue3局部组件</title>
</head>
<body>
  <div id="app"></div>
  <script src="https://unpkg.com/vue@next"></script>
  <script>
    const Counter = {
      data () {
        return {
          count: 0
        }
      },
      template: `
        <button>-</button>{{count}}<button>+</button>
      `
    }
    const app = Vue.createApp({
      components: {
        Counter
      },
      template: `
        <div>局部组件Counter: <counter /></div>
      `
    })
    app.mount('#app')
  </script>
</body>
</html>